export const formatCategorise = (arr, pid = null) => {
    for (let i of arr) {
        i.parentid = pid;
        if (i.nodes && i.nodes.length) {
            arr = arr.concat(formatCategorise(i.nodes, i.id));
            delete i.nodes;
        }
    }

    return arr;
};
